import request from "@/utils/request";

// 获取列表
export function getAllList(query) {
  return request({
    url: "/personnelManagement/getPage",
    method: "get",
    params: query,
  });
}
// 获取机构树
export function treeSelectDept() {
  return request({
    url: '/fxfz/sOrg/listOrgTree?orgId=0',
    method: 'get',
  })
}
// 获取机构人员
export function queryUserList(query) {
  return request({
    url: '/fxfz/suser/queryUsersByOrg',
    method: 'get',
    params: query
  })
}

// 保存
export function saveData(data) {
  return request({
    url: "/personnelManagement/save",
    method: "post",
    data:data
  });
}

// 修改
export function updateData(data) {
  return request({
    url: "/personnelManagement/updateById",
    method: "post",
    data:data
  });
}

// 查看
export function getDetail(id) {
  return request({
    url: "/personnelManagement/findById",
    method: "get",
    params:id
  });
}

// 获取创建人信息
export function getCreateInfo() {
  return request({
    url: "/personnelManagement/getHeadInfo",
    method: "get",
  });
}

//删除
export function del(id) {
  return request({
    url: "/personnelManagement/deleteById/"+id,
    method: "post",
  });
}

// 获取人员角色
export function getRoleList() {
  return request({
    url: "/personnelManagement/getRole",
    method: "get",
  });
}
//系统用户导入
export function sysUserImport(data) {
  return request({
    url: "/personnelManagement/sysUserImport",
    method: "post",
    data:data
  });
}
